package com.wyzy.book.service;

import com.wyzy.book.dao.BookDao;
import com.wyzy.book.model.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookService {
    @Autowired
    private BookDao bookDao;
    public List<Book> getBookList(){
        List<Book> books = bookDao.mockData();
        for(Book book:books){
            switch(book.getStatus()){
                case(1):{
                    book.setStatusCN("可借阅");
                    break;
                } case(2):{
                    book.setStatusCN("不可借阅");
                    break;
                } default:{
                    book.setStatusCN("无效");
                    break;
                }
            }
        }
        return books;
    }
}
